const request = require("@/common/api/interceptor");

exports.login = (data) => {
    return request.post({
        apiName: "登录",
        url: "login/authorize_mobile",
        data: data,
        loading: true,
    });
};

exports.authorizeUserInfo = (data) => {
    return request.post({
        apiName: " 授权用户信息",
        url: "we_chat/authorize_user_info",
        data: data,
        loading: true,
    });
};

exports.getRoleList = (data) => {
    return request.get({
        apiName: "获取选择角色数据",
        url: "role/get",
        data: data,
        loading: true,
    });
};

exports.chooseRole = (data) => {
    return request.put({
        apiName: "选择角色",
        url: "role/choose",
        data: data,
        loading: true,
    });
};

exports.createApprove = (data) => {
    return request.post({
        apiName: "创建学生审批",
        url: "student/create_approve",
        data: data,
        loading: true,
    });
};

exports.teacherCreateApprove = (data) => {
    return request.post({
        apiName: "老师 创建学生审批",
        url: "teacher/create_approve",
        data: data,
        loading: true,
    });
};

exports.approvePage = (data) => {
    return request.get({
        apiName: "学生审批分页列表-家长",
        url: "student/approve_page",
        data: data,
        loading: false,
    });
};


exports.studentApproveReview = (data) => {
    return request.put({
        apiName: "学生审批审核",
        url: "teacher/student_approve_review",
        data: data,
        loading: true,
    });
};


exports.studentApprovePage = (data) => {
    return request.get({
        apiName: "学生审批分页列表-教师",
        url: "teacher/student_approve_page",
        data: data,
        loading: false,
    });
};


exports.studentApproveDetails = (data) => {
    return request.get({
        apiName: "学生审批详情-教师",
        url: "teacher/student_approve_details",
        data: data,
        loading: true,
    });
};

exports.studentApproveDel = (params) => {
    return request.del({
        apiName: "学生审批删除",
        url: "student/delete_student_approve",
        params: params,
        loading: true,
    });
};



exports.approveDetails = (data) => {
    return request.get({
        apiName: " 学生审批详情-家长",
        url: "student/approve_details",
        data: data,
        loading: true,
    });
};


exports.getUserLastAccessControllerInfo = (data) => {
    return request.get({
        apiName: " 获取学生最后门禁信息",
        url: "student/get_last_access_control_info",
        data: data,
        loading: false,
    });
};

exports.getSchoolApp = (data) => {
    return request.get({
        is:'yyc',
        apiName: "小程序校园应用授权查询",
        url:  `app-school/weChatQuery/${data.schoolId}/${data.type}`,
        loading: false,
    });
};
